import { defineStore } from 'pinia'
import { ref } from 'vue'

const useLoadingStore = defineStore('loading', () => {
  const isShow = ref<boolean>(true)
  const isLoaderShow = ref<boolean>(false)

  // 显示/隐藏视频播放和视频推荐
  const change = (value: boolean) => {
    isShow.value = value
  }

  // 显示/隐藏加载页面
  const changeLoader = (value: boolean) => {
    isLoaderShow.value = value
  }

  return {
    change,
    changeLoader,
    isShow,
    isLoaderShow,
  }
})

export default useLoadingStore